<?php

    require "[system_path]system/framework.php";   

    $order = $_REQUEST['order'];
    $orderField = "item_order";  // $_REQUEST['orderfield']; 
    $table = general::stringToArray("[php_property:table]");  // $_REQUEST['table'];
    $arrayOrder = explode(",", $order);     


    
    
    

    //for ($n = 0; $n < sizeof($arrayOrder); $n++) {
    $n = 0;
    foreach ($arrayOrder as $orderId) {
        
        //$sql = "UPDATE $table SET $orderField=$n WHERE id='$orderId'";
        $sql = "UPDATE {$table[0]} SET $orderField=$n WHERE id='$orderId'";
        db::sqlExec($sql);
        
        $n++;
        
    }
   

?>